<?php

/**
 * Wiadomosc form base class.
 *
 * @package    portal
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseWiadomoscForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'ogloszenie_id' => new sfWidgetFormPropelChoice(array('model' => 'Ogloszenie', 'add_empty' => true)),
      'uzytkownik_id' => new sfWidgetFormPropelChoice(array('model' => 'Uzytkownik', 'add_empty' => false)),
      'tytul'         => new sfWidgetFormInput(),
      'tresc'         => new sfWidgetFormInput(),
      'created_at'    => new sfWidgetFormDateTime(),
      'id_odbiorcy'   => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorPropelChoice(array('model' => 'Wiadomosc', 'column' => 'id', 'required' => false)),
      'ogloszenie_id' => new sfValidatorPropelChoice(array('model' => 'Ogloszenie', 'column' => 'id', 'required' => false)),
      'uzytkownik_id' => new sfValidatorPropelChoice(array('model' => 'Uzytkownik', 'column' => 'id')),
      'tytul'         => new sfValidatorString(array('max_length' => 255)),
      'tresc'         => new sfValidatorInteger(array('required' => false)),
      'created_at'    => new sfValidatorDateTime(),
      'id_odbiorcy'   => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('wiadomosc[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Wiadomosc';
  }


}
